package com.link.base.base.product.dao.mybatis.mapper;

import com.link.base.base.product.model.ShopCart;
import com.link.core.basic.dao.mapper.BasicMapper;

/**
 * @author unknown
 * @date unknown
 * @comments 购物车
 */
public interface ShopCartMapper extends BasicMapper<ShopCart> {

    /**
     * 更新购物车上产品的数量
     * @param entity 购物车
     * @throws Exception
     */
    public void qtyUpdate(ShopCart entity) throws Exception;

    /**
     * 通过用户ID清空购物车
     * @param entity 购物车
     * @throws Exception
     */
    public void deleteByEmpId(ShopCart entity) throws Exception;

    /**
     * 查询当前登录用户的购物车中的产品数量
     * @param entity 购物车
     * @return int
     * @throws Exception
     */
    public int queryEmpProdCount(ShopCart entity) throws Exception;

    /**
     * <p>
     * 根据订单id删除购物车中产品，用于购物车直接下单提交后执行删除
     * </p>
     * <p>
     * attr1 orderId
     * </p>
     *
     * @author yrf
     * @param entity
     * @return int
     * @throws Exception
     */
    public int deleteByOrderId(ShopCart entity) throws Exception;
}
